# models/base.py
from extensions import db

class BaseModel(db.Model):
    """模型基类，包含公共字段和方法"""
    __abstract__ = True
    id = db.Column(db.String(36), primary_key=True)
    created_at = db.Column(db.DateTime, default=db.func.now())
    updated_at = db.Column(db.DateTime, default=db.func.now(), onupdate=db.func.now())